import React ,{ useState } from 'react';
import { Button, Space } from 'antd';
import "./Reply.scss"
import { Selector,Toast,TextArea} from 'antd-mobile'
import * as service from "../../../api/index"
import { useParams } from 'react-router-dom';
interface Props {

}

function Reply(props: Props) {
    var params=useParams()
      //收集评价内容
  var [huifunav,sethuifunav]:any=useState()
  const pingjiatext=(val:string)=>{
    huifunav=val
    sethuifunav(huifunav)
    console.log(huifunav)
  }
  //掉咨询接口 添加回复内容，改变待回复的状态

    const huifu=async ()=>{
        var res=await service.Zixun_update({id:params.id,huifunav,state:"已回复"})
        console.log(res)
        console.log(huifunav)
        console.log(params)
    }




    return (
        <div className='Reply'>
         
                <div className='header'>退回上级部门</div>

             
                <div className='text'>
                <div className='left'>咨询原因</div>
                  <div className='right'>  <TextArea onChange={val => pingjiatext(val)} defaultValue={"写其他建议和意见"} showCount /></div>
                </div>
       
                <Button className='btn' type="primary" onClick={huifu}>回复</Button>

        </div>
    );
}

export default Reply;